-
-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add elastic_stack_keystore resource to handle keystore files for both elasticsearch and kibana #71
base: master
Are you sure you want to change the base?
Conversation
mk_resource_methods | ||
|
||
def self.defaults_dir | ||
@defaults_dir ||= case Facter.value('osfamily') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please don't use the legacy fact osfamily, that's deprecated. Please use the nested os.family
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes of course. It's fixed.
Finally, I wonder if it wouldn't be more appropriate to implement the This would simplify the code and would be justified by the fact that there are differences in keystore management between |
Hello. Is there any news on this PR? The change suggested by @lcharreau seems interesting. |
Hello,
I needed to install Elasticsearch version 8 (with Kibana).
I had several problems configuring the keystore files (elasticsearch and kibana) using the
puppet-elasticsearch
andpuppet-kibana
modules.Here are the problems encountered:
elasticsearch_keystore
resource is not indempotent. It recreates the keystore file each time it is run, whether or not there has been a change. It does not parse the contents to ensure that the file is synchronized;I thought it simpler to implement a single resource type to manage the keystore in the
puppet-elastic_stack
module (to be used by both the elasticsearch and kibana modules). This avoids duplicate code.I used the
elasticsearch_keystore
resource to correct the problems encountered and added keystore management for Kibana. I didn't keep the notion of instances, which weren't necessarily of interest in my case.Example of the
elastic_stack_keystore
resource declaration for Elasticsearch:To manage the keystore password, there are 2 modes:
password
parameter is set and not empty, when the resource is executed, the keystore will be password-protected. However, it will not be possible to re-modify it by changing thepassword
parameter (this will have to be done manually on the target).password
parameter to be changed without having to do so manually. To do this, declare a resource file containing the (with thebackup
parameter set to true).I haven't included all the code in the elasticsearch module, just an example to illustrate.
Example of the
elastic_stack_keystore
resource declaration for Kibana (kibana-keystore does not support password):The
service
parameter is the namevar and can take 2 values:elasticsearch
orkibana
.